home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
MPW_TOOL
/
TOOLS
/
TOOLS_WI
/
ICON_8
/
ICONX_FO
/
OVALUE.C
< prev
next >
Wrap
Text File
|
1990-03-02
|
1KB
|
79 lines
/*
* File: ovalue.c
* Contents: nonnull, null, value
*/
#include "::h:config.h"
#include "::h:rt.h"
#include "rproto.h"
#ifdef PreProcess
/* include(../M4/ops.m4) /* */
/* */
#endif /* PreProcess */
/*
* \x - test x for nonnull value.
*/
#ifdef WATERLOO_C_V3_0
struct b_iproc Bnonnull = {
T_Proc,
Vsizeof(struct b_proc),
Ononnull,
1,
-1,
0,
0,
{sizeof(BackSlash)-1,BackSlash}}; Ononnull(cargp,sptr) register dptr cargp;
#else /* WATERLOO_C_V3_0 */
OpDcl(nonnull,1,BackSlash)
#endif /* WATERLOO_C_V3_0 */
{
/*
* If Arg1 is not null, it is returned, otherwise, the function fails.
* Because the pre-dereference value of Arg1 is the return value (if
* any), Arg1 is copied into Arg0.
*/
Arg0 = Arg1;
if (DeRef(Arg1) == Error)
RunErr(0, NULL);
if (ChkNull(Arg1))
Fail;
Return;
}
/*
* /x - test x for null value.
*/
OpDcl(null,1,"/")
{
/*
* If Arg1 is null, it is returned, otherwise, the function fails.
* Because the pre-dereference value of Arg1 is the return value (if
* any), Arg1 is copied into Arg0.
*/
Arg0 = Arg1;
if (DeRef(Arg1) == Error)
RunErr(0, NULL);
if (!ChkNull(Arg1))
Fail;
Return;
}
/*
* .x - produce value of x.
*/
OpDcl(value,1,".")
{
if (DeRef(Arg1) == Error)
RunErr(0, NULL);
Arg0 = Arg1;
Return;
}